package com.yg.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yg.config.result.R;
import com.yg.entity.singleEntity.Dictionary;
import com.yg.service.DictionaryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 此表为字典表，对应各个表中的下拉数据 前端控制器
 * </p>
 *
 * @author YingGu
 * @since 2020-11-04
 */
@CrossOrigin
public class DictionaryController {


    @Autowired
    private DictionaryService dictionaryService;

    /**
     * 获取教师职称
     *
     * @return
     */
    @GetMapping("getTitle")
    @ApiOperation("获取教师职称")
    public R getTitle() {
        List<Dictionary> list = dictionaryService.getTitle();

        return R.OK().data("title", list);
    }

    /**
     * 最高学位
     *
     * @return
     */
    @GetMapping("getDegree")
    @ApiOperation("最高学位")
    public R getDegree() {

        List<Dictionary> list = dictionaryService.getDegree();

        return R.OK().data("degree", list);
    }

    /**
     * 最高学历
     *
     * @return
     */
    @GetMapping("getEducation")
    @ApiOperation("最高学历")
    public R getEducation() {

        List<Dictionary> list = dictionaryService.getEducation();

        return R.OK().data("education", list);
    }
}
